/*
 * @Author: xiaosihan
 * @Date: 2021-05-23 16:11:03
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2021-08-02 00:31:49
 */

import * as THREE from "three";
import THREEInstancedMesh from "../InstancedMesh/THREEInstancedMesh";

/**
 * 碰撞计算专用的立方体实例模型
 */
export default class CollideCubeInstanceMesh extends THREEInstancedMesh {

    constructor() {
        super(CollideCubeInstanceMesh.boxGeometry, CollideCubeInstanceMesh.material);
    }

    // renderOrder = 99;

    static boxGeometry = new THREE.BoxBufferGeometry(1, 1, 1, 1, 1, 1);

    static material = (() => {
        let material = new THREE.MeshNormalMaterial();

        Object.assign(material, {
            transparent: true,
            opacity: 0.3,
            side: THREE.DoubleSide
        });

        return material;
    })();
}